#ifndef SPHERE_H_
#define SPHERE_H_

#include "Renderable.h"

class Sphere : public Renderable
{
public:
    Sphere() : m_rad(0.0f) {}
    Sphere(const Vec3& pos, float radius, const Material& m, bool reflect,float reflectance) : Renderable(m,reflect,reflectance),
    m_pos(pos), m_rad(radius){}
    Sphere(const Vec3& pos, float radius, const Material& m, 
           bool reflect,float reflectance, bool transparent, float opacity) : 
           Renderable(m,reflect,reflectance,transparent, opacity),
           m_pos(pos), m_rad(radius){}

    virtual bool Hit(const Ray& ray, float& tmin, ContactData& data) const;
    virtual void CalculateBox()
    {
        m_hasValidBox = true;
        m_box.CreateFromPosAndHalf(m_pos, Vec3(m_rad,m_rad,m_rad));
#ifdef DEBUGGING
        m_information += "Class:  Sphere \n";
#endif
    }
    void SetPosition(float x, float y, float z);
    void SetRadius(float rad);
private:
    Vec3 m_pos;
    float m_rad;
};
#endif